import { defineStore } from 'pinia';

export const useCounterStore = defineStore('counter', {
  state: () => ({
    count: 0,
    countA:0,
    countB:0
  }),
  getters: {
    addAB: (state) => state.countA  + state.countB,
    subAB: (state) => state.countA  - state.countB,
  },
  actions: {
    increment() {
      this.count++;
    },
    decrement() {
      this.count--;
    },
    incrementA(){
        this.countA++;
    },
    incrementB(){
        this.countB++;
    }
  }
});